const {
	http
} = uni.$u

import {
	fileBaseUrl,
	
} from "./config.js";

export const fileUrl = fileBaseUrl;

const employeesThrough = "/employeesThrough";

const permission = "/permission";

export const tempLogin = (params, config = {}) => http.post(permission +
	`/app/tempLogin`, params,
	config)

//用户信息 
export const userInfor = (params, config = {
	custom: {
		toast: false
	}
}) => http.post(employeesThrough + '/app/sysUser/getUserId', params,
	config)

//首页轮播图
export const bannerList = (params, config = {}) => http.post('/office/web/bannerInfo/list', params,
	config)


/**
 * 拼接url参数
 * @param obj
 * @returns {string}
 */
export function buildUrlParam(obj) {
	let result = "";
	let item;
	for (item in obj) {
		if (obj[item] && String(obj[item])) {
			result += `&${item}=${obj[item]}`;
		}
	}
	if (result) {
		result = "?" + result.slice(1);
	}
	return result;
}
